<script>
function reset(){
    document.getElementById('kontakt').reset();
}
function check_name(){
    var name = document.getElementById('contact_name').value;
    if(name=='Navn'){
        document.getElementById('contact_name').value = "";
    }
    else if(name==""){
        document.getElementById('contact_name').value = "Navn";
    }
    else{
        document.getElementById('contact_name').value = name;
    }
}
function check_tif(){
    var tif = document.getElementById('contact_tif').value;
    if(tif=='Telefonnr'){
        document.getElementById('contact_tif').value = "";
    }
    else if(tif==""){
        document.getElementById('contact_tif').value = "Telefonnr";
    }
    else{
        document.getElementById('contact_tif').value = tif;
    }
}
function check_address(){
    var address = document.getElementById('contact_address').value;
    if(address=='Adresse'){
        document.getElementById('contact_address').value = "";
    }
    else if(address==""){
        document.getElementById('contact_address').value = "Adresse";
    }
    else{
        document.getElementById('contact_address').value = address;
    }
}
function check_postnr(){
    var postnr = document.getElementById('contact_postnr').value;
    if(postnr=='Postnr'){
        document.getElementById('contact_postnr').value = "";
    }
    else if(postnr==""){
        document.getElementById('contact_postnr').value = "Postnr";
    }
    else{
        document.getElementById('contact_postnr').value = postnr;
    }
}
function check_by(){
    var by = document.getElementById('contact_by').value;
    if(by=='By'){
        document.getElementById('contact_by').value = "";
    }
    else if(by==""){
        document.getElementById('contact_by').value = "By";
    }
    else{
        document.getElementById('contact_by').value = by;
    }
}
function check_emne(){
    var emne = document.getElementById('contact_emne').value;
    if(emne=='Emne'){
        document.getElementById('contact_emne').value = "";
    }
    else if(emne==""){
        document.getElementById('contact_emne').value = "Emne";
    }
    else{
        document.getElementById('contact_emne').value = emne;
    }
}
function check_email(){
    var email = document.getElementById('contact_email').value;
    if(email=='Email'){
        document.getElementById('contact_email').value = "";
    }
    else if(email==""){
        document.getElementById('contact_email').value = "Email";
    }
    else{
        document.getElementById('contact_email').value = email;
    }
}
function check_text(){
    var text = document.getElementById('contact_text').innerHTML;
    if(text=='Besked'){
        document.getElementById('contact_text').innerHTML = "";
    }
    else if(text==""){
        document.getElementById('contact_text').innerHTML = "Besked";
    }
    else{
        document.getElementById('contact_text').innerHTML = text;
    }
}
function Validateform()
{			
	var Form = document.kontakt;
    var name = document.getElementById('contact_name').value;
    var email = document.getElementById('contact_email').value;

	var error=document.getElementById("error");
    if(name==""||name=="Navn"){
        error.innerHTML='<div align="center" style="color:#F00; padding-top: 5px;">Navn skal udfyldes</div>';
		document.getElementById('contact_name').value = "";
        Form.name.focus();
		return;	
	}
    else {
		error.innerHTML="";
	}
    if (!checkEmail()||email=='Email'){	
		error.innerHTML='<div align="center" style="color:#F00; padding-top: 5px;">Email skal udfyldes</div>';
		document.getElementById('contact_email').value = "";
        Form.email.focus();
		return;	
	}
	else {
		error.innerHTML="";
	}
    document.getElementById('kontakt').submit();
}
function checkEmail() 
{
	var yemail = document.getElementById('contact_email');
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!filter.test(yemail.value)) {
			return 0;
		}
		else{
			return 1;
		}
}
</script>
<div id="main">
    <div class="m20l m20r m20t">
    	<div class="bg_imgleft">
        	<img src="<?php echo base_url(); ?>assets/img/map.jpg" alt="" />
        </div>
        <div class="w590 float_right">
        <form name="kontakt" id="kontakt" action="<?php echo base_url(); ?>kontakt_send.html" method="post">
        
           	<p class="title_1">Kontakt</p>
        	<div class="m17t">
            	<img src="<?php echo base_url(); ?>assets/img/tt_kontakt.png" alt="" />
                <p class="p10t color_1 bd1b p10b">
                	Frederisberg alle 55<br /> 
                    1820 Frederiksberg C<br />   
                    Tlf:  33 31 62 52 <br /> 
                    Email: <a href="mailto:info@bjørnekælderen">info@bjørnekælderen</a>
                </p>
                <div id="error"></div>
                <div class="w225 input_form float_left p15t">
               	  <input type="text" value="Navn" name="name" id="contact_name" onclick="check_name();" onblur="check_name();" class="w215" /><br />
                  <input type="text" value="Telefonnr" name="tif" id="contact_tif" onclick="check_tif();" onblur="check_tif();" class="w215" /><br />
                  <input type="text" value="Adresse" name="address" id="contact_address" onclick="check_address();" onblur="check_address();" class="w215" /><br />
                  <input type="text" value="Postnr" name="postnr" id="contact_postnr" onclick="check_postnr();" onblur="check_postnr();" class="w60" />
                  <input type="text" value="By" name="by" id="contact_by" onclick="check_by();" onblur="check_by();" class="w146" /><br />
                  <input type="text" value="Email" name="email" id="contact_email" onclick="check_email();" onblur="check_email();" class="w215" /><br />
                  <input type="text" value="Emne" name="emne" id="contact_emne" onclick="check_emne();" onblur="check_emne();" class="w215" /><br />
                  <a href="javascript:void(0);" onclick="Validateform();"><img src="<?php echo base_url(); ?>assets/img/bt_send.png" alt="" /></a>
                  <a href="javascript:void(0);" onclick="reset();"><img src="<?php echo base_url(); ?>assets/img/bt_nulstil.png" alt="" /></a>
                </div>
                <div class="w225 input_form float_left p15t">
                	<textarea name="text" id="contact_text" onclick="check_text();" onblur="check_text();" class="w215 h163">Besked</textarea>
                </div>
                <div class="clear_left"></div>
            </div>
            
        </form> 
        </div>
        <div class="clear"></div>
    </div>
</div>
<script>
jQuery(document).ready(function(){
	jQuery("#kontakt_current").addClass('current');
	});
</script>